﻿using JetBrains.Annotations;
using Missbot.AIModule.Gaming.SignIn;
using Missbot.Core.Base;

namespace Missbot.AIModule.Vip.VipArmers
{
    [UsedImplicitly]
    public class 补签卡 : IVipArmer
    {
        public string Name { get; set; } = "补签卡";
        public string Description { get; set; } = "补签当前群组最近一次漏签的签到（不算今天），每天可购买三次";
        public int DiamondsNeed { get; set; } = 10;
        public VipArmerLimitInterval LimitInterval { get; set; } = VipArmerLimitInterval.Daily;
        public int LimitCount { get; set; } = 3;

        public bool Purchase(InboxSession session)
        {
            var rec = SignInSuccessiveDA.MakeUp(session.Group.ID, session.User.ID);
            if (rec == null)
            {
                session.SendBack("未查找到签到记录，无法补签！");
                return false;
            }

            var msg = $"补签成功！你当前连续签到 {rec.SuccessiveDays()}天！";
            session.SendBack(msg);
            return true;
        }

        public int MaxContains { get; set; }
    }
}